<script>
import { reactive } from "vue";
export default {
  setup() {
    let data = reactive({
      lists: [
        { id: 1, text: "书城", to:"/home", clasname: "icon-zhu-ye" },
        { id: 2, text: "分类", to:"/classify", clasname: "icon-fenlei1" },
        { id: 3, text: "书柜", to:"/shelf", clasname: "icon-shuben" },
        { id: 4, text: "我的", to:"/center", clasname: "icon-iconfuzhi" },
      ],
    });

    return {
      data,
    };
  },
};
</script>


<template>
  <div class="bomnav">
    <ul class="bomlist">
      <!-- 底部按钮遍历 -->
      <li class="bomitem" v-for="item in data.lists" :key="item.id">
        <router-link :to="item.to">
          <i :class="['iconfont', item.clasname]"></i>
          <span>{{ item.text }}</span>
        </router-link>
      </li>
    </ul>
  </div>
</template>

<style lang="scss" scoped>
.bomnav {
  // height: 40px;
  width: 100%;
  background-color: #fff;
  // background-color: red;
  position: fixed;
  bottom: 0px;
  box-shadow: 0px 0px 5px #ccc;
  .bomlist {
    display: flex;
    align-items: center;
    align-content: center;
    justify-content: space-between;
    height: 100%;
    width: 100%;

    .bomitem {
      transform: scale(0.8);
      a {
        display: flex;
        flex-direction: column;
        align-items: center;
        align-content: center;
        margin: 0 25px;
        font-size: 12px;
        color: #333;
        i {
          font-size: 26px;
          font-weight: 400;
        }
        p {
          width: 18px;
        }
      }
      .router-link-exact-active{
        color: #ff8324;
      }
    }
  }
}
</style>
